package com.swipemaster.achievements;

import java.io.Serializable;

public class Achievements implements Serializable
{
	private static final long serialVersionUID = 1L;
	private long mGamesPlayed = 0;
	private int mStars = 0;
	private ChallengeRecord mChallengeRecord = new ChallengeRecord();
	private float mSurvivalRecord = 0.0f;
	private float mAvgTimeFromPuzzleRecords = 0.0f;
	private float mAvgTimeFromSurvivalRecords = 0.0f;
	private LevelsInfo levelsInfo = new LevelsInfo();

	public class ChallengeRecord implements Serializable
	{
		private static final long serialVersionUID = 1L;
		public int level = 0;
		public float seconds = 0.0f;

		@Override
		public String toString()
		{
			return "Level " + level + ",\n" + seconds + "s";
		}
	}

	public void addGamesPlayed()
	{
		mGamesPlayed++;
	}

	public void addStars(int starsToAdd)
	{
		mStars += starsToAdd;
	}

	public float getAvgTimeFromPuzzleRecords()
	{
		return mAvgTimeFromPuzzleRecords;
	}

	public float getAvgTimeFromSurvivalRecords()
	{
		return mAvgTimeFromSurvivalRecords;
	}

	public ChallengeRecord getChallengeRecord()
	{
		return mChallengeRecord;
	}

	public long getGamesPlayed()
	{
		return mGamesPlayed;
	}

	public int getStars()
	{
		return mStars;
	}

	public float getSurvivalRecord()
	{
		return mSurvivalRecord;
	}

	public void setAvgTimeFromPuzzleRecords(float avgTimeFromPuzzleRecords)
	{
		mAvgTimeFromPuzzleRecords = avgTimeFromPuzzleRecords;
	}

	public void setAvgTimeFromSurvivalRecords(float avgTimeFromSurvivalRecords)
	{
		mAvgTimeFromSurvivalRecords = avgTimeFromSurvivalRecords;
	}

	public void setChallengeRecord(int level, int seconds)
	{
		mChallengeRecord.level = level;
		mChallengeRecord.seconds = seconds;
	}

	public void setSurvivalRecord(float survivalRecord)
	{
		mSurvivalRecord = survivalRecord;
	}

	public LevelsInfo getLevelsInfo()
	{
		return levelsInfo;
	}
}
